package cn.hnh.controller;

import cn.hnh.service.IndexService;
import cn.hnh.vo.IndexVo;
import cn.hnh.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author HuangNianHong
 * @Time 2021/1/5
 */
@RestController
@Api(tags = "文章首页接口规范描述")
public class IndexController {

    @Autowired
    private IndexService indexService;

    @ApiOperation(value = "分页查询文章标题内容信息")
    @ApiImplicitParam(name = "pagenum",value = "当前页码",dataType = "Integer")
    @RequestMapping("/index/{pagenum}")
    public Result<IndexVo> getIndexVo(@PathVariable("pagenum")int pagenum){
        return indexService.getIndexVo(pagenum);
    }
}
